package com.hdit.guimei.service.impl;

import com.hdit.guimei.domain.Collection;
import com.hdit.guimei.domain.Goods;
import com.hdit.guimei.mapper.CollectionMapper;
import com.hdit.guimei.service.CollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 张宝玉
 * @date 2021/2/23 9:53
 */
@Service
public class CollectionServiceImp implements CollectionService {
    @Autowired
    private CollectionMapper collectionMapper;
    @Override
    public int AddColl(int id, int good_id) {
        int i = collectionMapper.AddCollect(id, good_id);
        return i;
    }
    //查看用户收藏的商品的编号
    @Override
    public List<Collection> FindCollGood_id(int id) {
        List<Collection> list = collectionMapper.FindCollection2(id);
        return list;
    }

    @Override
    public List<Goods> FindCollGood_detail(int id) {
        List<Goods> goodsList = collectionMapper.FindCollection1(id);
        return goodsList;
    }

    @Override
    public int DeleCollection(int id, int good_id) {
        int i = collectionMapper.delCollectionGood(id, good_id);
        return i;
    }
}
